<?php 
	class Block_model extends CI_Model
	{
		private $table = "no_menu";
			
		function _getParentMenu()
		{
			$this->db->select('id,parent_id,name,slug,order,link');
			$this->db->where('status',1);
			$this->db->where('parent_id',0);
			$this->db->order_by('order','DESC');
			$query = $this->db->get($this->table);
			$result = $query->result_array();
			$query->free_result();
			
			return $result;
		}
		
		function _getChildMenu($parent_id)
		{
			$this->db->select('id,parent_id,name,slug,order,link');
			$this->db->where('parent_id',$parent_id);
			$this->db->where('status',1);
			$this->db->order_by('order','DESC');
			$query  = $this->db->get($this->table);
			$result = $query->result_array();
			$query->free_result();
			
			return $result;
		}
		
		function _getSubMenu($id = 0)
		{
			$this->db->select('*');
			$this->db->where('parent_id',$id);
			$this->db->order_by('name','desc');
			$query = $this->db->get('hts_categories');
			$result = $query->result_array();
			$query->free_result();
			
			return $result;
		}
		
		function thongtin()
		{
			$this->db->select('*');
			$this->db->where('parent_id','1');
			$this->db->order('order','DESC');
			$query = $this->db->get('hts_general');
			
			$result = $query->result();
			$query->free_result();
			return $result;
		}
	}
?>